<template>
<div class="page">
  <nav-top title="查看物流"></nav-top>
  <page-content>
    <order-breviary :data="info" inLogistics></order-breviary>
    <xl-content class="nmb">
      <div class="content-block bb">
        <p class="title">物流跟踪</p>
      </div>
    </xl-content>
    <log-info :data="logiData" v-if="logiData"></log-info>
    <div class="row" v-if="!logiData">
      暂无物流信息
    </div>
  </page-content>
</div>
</template>
<script>
import navTop from '@c/header/navTop'
import pageContent from '@c/pagecontent'
import orderBreviary from '@c/orderBreviary'
import xlContent from '@c/content.vue'
import logInfo from './logisticsInfo'
import {getLogistics} from '../../config/api.js'
export default {
  name: 'logistics',
  components:{
    navTop,
    pageContent,
    orderBreviary,
    xlContent,
    logInfo
  },
  // props:,
  data () {
    return {
      info:{
        state:'运输中',
        company:'申通快递',
        logNum:'15252566546',
        img:'../../../static/sununionCoreII3_big2.jpg'
      },
      logiData:[]
      }
  },
  methods:{
    
  },
  beforeRouteEnter: (to, from, next) => {
    next(vm=>{
        getLogistics({
          user_id:vm.$store.state.user_id,
          order_id:to.query.id
        }).then(res=>{
          if(res.status ==200){
            vm.logiData = res.data.data.itemList.logisticsInfo
          }
        })
    })
  }
}
</script>
<style lang='scss'>

</style>